package com.fs.controller;

import com.fs.service.GoodsFavouriteService;
import com.fs.vo.CommRequestVO;
import com.fs.vo.ResultVO;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

@RestController
@RequestMapping("/fav")
public class FavController {

    @Autowired
    private GoodsFavouriteService goodsFavouriteService;

    @PostMapping("/add")
    public ResultVO fav(Integer uid, Integer gid){
        return goodsFavouriteService.fav(uid,gid);
    }

    @GetMapping("/list")
    public ResultVO list(CommRequestVO vo){
        return goodsFavouriteService.list(vo);
    }

    @DeleteMapping("/clearAll")
    public ResultVO clearAll(){
        return goodsFavouriteService.clearAll();
    }
}
